#!/bin/bash
d=`df -h|grep "/dev/sda1" |awk '{print int($5)}'`
#d=`df / | awk '$5=="/"{sub("%","",$4);print $4}'`
#re=`/usr/sbin/ip addre|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
re=`/usr/sbin/ip add|grep inet|grep -v 127.0.0.1|grep -v inet6|grep -v inet6|cut -d/ -f1 |awk '{print $2}'`
if [[ $d -gt 80 ]]; then
    #LC_ALL=C ifconfig|grep "inet"|grep -v "127.0.0.1"|cut -d: -f2|awk '{print $2}'
   #re=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
   echo "${re},the /dev/sda1 has using ${d}%,you need clearing!"
else
    echo "${re}, /dev/sda1 has using ${d}% ，/dev/sda1 enough"
fi
